package com.zy.oopthis;

public class Boy {
    private String name;
    private int age;
    //bean可以构建方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void  marry(Girl girl){
        System.out.println(this.getName()+"和"+girl.getName()+"结婚。");
    }
    public void shout(){
        System.out.println("大声对女孩说结婚吧。");
    }
}
